<template>
  <div>
    <p>客户姓名</p>
    <el-input v-model="newOrder.customer"></el-input>
    <p>客户电话</p>
    <el-input v-model="newOrder.phone"></el-input>
    <p>客户地址</p>
    <el-input v-model="newOrder.address"></el-input>
    <p>订单详情</p>
    <el-input v-model="newOrder.information"></el-input>

    <div id="action">
      <el-button type="danger"
                 size="mini"
                 @click="commit">确定</el-button>
      <el-button type="success"
                 size="mini"
                 @click="cancel">取消</el-button>
    </div>

  </div>
</template>
<script>
export default {
  data () {
    return {
      newOrder: {},
      src: this.order.image,
    }
  },
  methods: {

    cancel () {
      this.$emit("closedialog", { result: true, data: {} })
    },
    commit () {
      this.$emit("closedialog", { result: true, data: this.newOrder })
    }
  },
  mounted () {
    //js深拷贝
    //stringify  转换成json格式的字符串
    //parse   将字符串转换成JSON数据  对象
    this.newOrder = JSON.parse(JSON.stringify(this.order));
  },
  props: {
    order: {},//用来接收父组件传过来的数据
  }
}
</script scoped>
<style scoped>
h3 {
  color: red;
}
* {
  /* font-family: "微软雅黑"; */
  font-family: "PingFang SC";
}
</style>